import QtQuick 2.0

Item {
    id:root
    width: 850
    height: 580
    property real minSize:  Math.min(width/850, height/580)
    property real textSize:  40*minSize


    function refurbish()
    {
        function factorTransform(var1)
        {
            var var2 =  $sqlMcRecorder.qml_getRegulatorVal_bystr_toint16(var1)
            console.log(var2)
            if(var2 === 0) return "???"
            else {
                var2 = 0.01*var2
                console.log(var2)
                return String(var2.toFixed(2))
            }
        }
        var t_var = factorTransform("A套AVR版本号")
        rega_avr.text = t_var
        t_var = factorTransform("A套FPGA版本号")
        rega_fpga.text = t_var
        t_var = factorTransform("B套AVR版本号")
        regb_avr.text = t_var
        t_var = factorTransform("B套FPGA版本号")
        regb_fpga.text = t_var
    }

    onFocusChanged:{
        if(!focus) return
        refurbish()
    }

    Text {
        x: 160*root.minSize
        y: 110*root.minSize
        color: "#44fdfd"
        text: qsTr("A通道程序版本:")
        font.bold: true
        font.family: "Verdana"
        font.pixelSize: parent.textSize
    }

    Text {
        x: 495*root.minSize
        y: 110*root.minSize
        color: "#bccc5a"
        text: qsTr("AVR:")
        font.bold: true
        font.family: "Verdana"
        font.pixelSize: parent.textSize
    }

    Text {
        id:rega_avr
        x: 620*root.minSize
        y: 110*root.minSize
        color: "#bccc5a"
        text: "???"
        font.bold: true
        font.family: "Verdana"
        font.pixelSize: parent.textSize
    }

    Text {
        x: 470*root.minSize
        y: 180*root.minSize
        color: "#bccc5a"
        text: qsTr("FPGA:")
        font.bold: true
        font.family: "Verdana"
        font.pixelSize: parent.textSize
    }

    Text {
        id:rega_fpga
        x: 620*root.minSize
        y: 180*root.minSize
        color: "#bccc5a"
        text: "???"
        font.bold: true
        font.family: "Verdana"
        font.pixelSize: parent.textSize
    }


    Text {
        x: 160*root.minSize
        y: 270*root.minSize
        color: "#44fdfd"
        text: qsTr("B通道程序版本:")
        font.family: "Verdana"
        font.bold: true
        font.pixelSize: parent.textSize
    }

    Text {
        id:regb_avr
        x: 620*root.minSize
        y: 270*root.minSize
        color: "#bccc5a"
        text: "???"
        font.family: "Verdana"
        font.bold: true
        font.pixelSize: parent.textSize
    }

    Text {
        x: 470*root.minSize
        y: 340*root.minSize
        color: "#bccc5a"
        text: qsTr("FPGA:")
        font.family: "Verdana"
        font.bold: true
        font.pixelSize: parent.textSize
    }

    Text {
        id:regb_fpga
        x: 620*root.minSize
        y: 340*root.minSize
        color: "#bccc5a"
        text: "???"
        font.family: "Verdana"
        font.bold: true
        font.pixelSize: parent.textSize
    }

    Text {
        x: 495*root.minSize
        y: 270*root.minSize
        color: "#bccc5a"
        text: qsTr("AVR:")
        font.family: "Verdana"
        font.bold: true
        font.pixelSize: parent.textSize
    }

    EXC_Normal_BtnUncheckStyle {
        id: button3
        nameText: qsTr("返回")
        nameFontpixelSize: 30*Math.min(root.width/850, root.height/580)
        width: parent.width*0.15
        height: parent.height*0.09
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: 500*root.minSize
        anchors.top: parent.top
        onClicked: {
            sw.currentIndex = 0
        }
    }
}
